﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using OpenTK.Graphics;
using OpenTK;
using Clandestine.Graphics.Window;

namespace Clandestine.Graphics
{
	internal class LoadingContext
	{
		// Invisible windows.  Yes, really.  Sorry about that.

		private GraphicsContext context;
		private NativeWindow window;

		public LoadingContext()
		{
			window = new NativeWindow();
			context = new GraphicsContext(GraphicsMode.Default, window.WindowInfo);
			context.SetupAuto(window);
		}

		public void MakeContextCurrent()
		{
			context.MakeCurrent(window.WindowInfo);
		}

		public void ReleaseContext()
		{
			context.MakeCurrent(null);
		}
	}
}
